<extend name="Base/common"/>

<block name="style">
    <link href="__CSS__/question.css" rel="stylesheet" type="text/css"/>

</block>

<block name="body">
    <div class="col-md-12">
        <!--轮播图片-->
        {:hook('Advs', 'question_index_index')}
        <!--/轮播图片-->
    </div>
    <div class="col-md-9">
        <div class="bgwhite clearfix" style="">
            <div class="question_h">
                <h2 class="pull-left" style="width: 100px;">问题</h2>
                <a class="pull-right ask change ask_question_link"
                   style="line-height: 45px;margin-right: 15px;color: #f36119;padding: 0;font-size: 14px;"
                   href="{:U('question/usercenter/ask')}">发布问题</a>
            </div>

            <div class="filter" style="padding-left: 15px;padding-right: 15px;">
                <p>类别：
                    <a href="{:U('question/index/index',array('type'=>0,'order'=>$order))}"
                    <if condition="$type eq 0">class="active"</if>
                    style="margin-left: 15px">全部</a>
                    <volist name="typeList" id="val">
                        <a href="{:U('question/index/index',array('type'=>$val['id'],'order'=>$order))}"
                        <if condition="$type eq $val['id']">class="active"</if>
                        style="margin-left: 15px">{$val.title}</a>
                    </volist>
                </p>

                <div class="dashed"></div>
                <p>排序：
                    <a href="{:U('question/index/index',array('type'=>$type,'order'=>'all'))}"
                    <if condition="$order eq 'all'">class="active"</if>
                    style="margin-left: 15px">推荐</a>
                    <a href="{:U('question/index/index',array('type'=>$type,'order'=>'create_time'))}"
                    <if condition="$order eq 'create_time'">class="active"</if>
                    style="margin-left: 15px">最新</a>
                    <a href="{:U('question/index/index',array('type'=>$type,'order'=>'answer_num'))}"
                    <if condition="$order eq 'answer_num'">class="active"</if>
                    style="margin-left: 15px">回答最多</a>
                </p>
            </div>
            <div class="solid"></div>

            <div id="question_list_append" class="question_list clearfix" style="padding-left: 5px;padding-right: 5px;">
                <if condition="count($questionList) eq 0"><p class="text-muted"
                                                             style="text-align: center; font-size: 3em;">
                    <br><br>
                    没有符合条件的问题～
                    <br><br><br>
                </p></if>
                <php>
                    if(C('QUESTION_WORDS_COUNT')){
                    $Question_words_count=C('QUESTION_WORDS_COUNT');
                    }else{
                    $Question_words_count=1000;
                    }
                </php>

                <volist name="questionList" id="question">
                    <include file="Public/_question"/>
                </volist>
                <div style="width: 100%;text-align: center;">
                    {:getPagination($totalCount,50)}
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-3">
        <div class="bgwhite">
            <include file="Public/_goodquestion"/>
        </div>
        <include file="Public/guai"/>
        <include file="Public/link"/>
    </div>
</block>
<block name="script">
    <script>
        initAnswerNum="{:C('QUESTION_WORDS_COUNT')}"?"{:C('QUESTION_WORDS_COUNT')}":1000;
    </script>
    <script type="text/javascript" src="__JS__/question.js"></script>
    <script type="text/javascript" src="__JS__/share.js"></script>
</block>

